package nmf;

import java.util.Random;

import org.ejml.ops.RandomMatrices;
import org.ejml.simple.SimpleMatrix;

public class NMFAlgorithmBenchmarking {
   
   /**
    * @param args
    */
   public static void main(final String[] args) {
      final double[][] A = { { 1 }, { 2 }, { 3 }, { 2 }, { 1 }, { 3 }, { 1 }, { 2 }, { 1 }, { 3 } };
      final double[][] B = { { 1, 1, 2, 1, 3, 1, 2, 1, 1, 2 } };
      //      double[][] d = {{5, 2, 1, 0, 1}, 
      //                      {8.7, 2.6, 0, 30.4, 13.5},
      //                      {0, 1, 12, 3.2, 6.7},
      //                      {3.14, 2.71, 1.41, 1.55, 3.25},
      //                      {6, 0.388888888, 51.0/57.0, 2.112, 1}};
      final SimpleMatrix A_matrix = new SimpleMatrix(A);
      final SimpleMatrix B_matrix = new SimpleMatrix(B);
      final SimpleMatrix V = A_matrix.mult(B_matrix);
      
      //SimpleMatrix V = new SimpleMatrix(d);
      System.out.println(V.toString());
      RandomMatrices.setRandom(V.getMatrix(), 0, 100, new Random());
      final SimpleMatrix W = NMFAlgorithm2.factor(V);
      System.out.println("\n" + W.toString());
   }
   
}
